import IndexModel from '@/models';
import GalleryModel from '@/models/gallery';
import GalleryService from '@/services/galleryService';
import { action, computed, observable } from 'mobx';

export default class Gallerystore {

    @observable
    pageSize?: number = 5;
    @observable
    pageNumber?: number = 1;
    @observable
    galleryList?: Array<GalleryModel>;
    @observable
    newsListLoading: boolean = false;

    @action
    async listGallery() {
        this.newsListLoading = true;
        this.galleryList = (await GalleryService.list(this.pageNumber, this.pageSize)).dataList;
        this.newsListLoading = false;
        console.log(this.galleryList);

    }
}

export const galleryStore = new Gallerystore();
